//
//  HeadImageModelCell.m
//  BobNews
//
//  Created by lanou3g on 16/5/6.
//  Copyright © 2016年 YJC. All rights reserved.
//

#import "HeadImageModelCell.h"
#import "UIImageView+WebCache.h"
@interface HeadImageModelCell ()
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UIImageView *firstImageView;
@property (weak, nonatomic) IBOutlet UIImageView *secondImageView;
@property (weak, nonatomic) IBOutlet UILabel *firstContentLabel;
@property (weak, nonatomic) IBOutlet UILabel *secondContentLabel;

@property (weak, nonatomic) IBOutlet UILabel *classificationLabel;
@property (weak, nonatomic) IBOutlet UILabel *concernCountLabel;
@property (weak, nonatomic) IBOutlet UILabel *talkCountLabel;



@end
@implementation HeadImageModelCell
- (void)setModel:(HeadImageModel *)model {
    if (_model != model) {
        _model = model;
    }
}

- (void)layoutSubviews {
    self.nameLabel.text = self.model.name;
   
    self.firstContentLabel.text = self.model.talkContent[0][@"content"];
        self.secondContentLabel.text = self.model.talkContent[1][@"content"];
    self.classificationLabel.text = self.model.classification;
    self.concernCountLabel.text = [NSString stringWithFormat:@"%@关注",self.model.concernCount];
    self.talkCountLabel.text = [NSString stringWithFormat:@"%@评论",self.model.talkCount];
    if (self.model.talkContent[0][@"userHeadPicUrl"]) {
         [self.firstImageView sd_setImageWithURL:[NSURL URLWithString:self.model.talkContent[0][@"userHeadPicUrl"]]];
    }else if (self.model.talkContent[1][@"userHeadPicUrl"]) {
        [self.secondImageView sd_setImageWithURL:[NSURL URLWithString:self.model.talkContent[1][@"userHeadPicUrl"]]];
    }
    self.firstImageView.image = [UIImage imageNamed:@"t2.gif"];
    self.secondImageView.image = [UIImage imageNamed:@"t2.gif"];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
